
<!DOCTYPE html>
<html>
{[include file="_header.tpl"]}
<body>

<header class="navbar navbar-fixed-top bs-docs-nav">
    {[include file="_nav.tpl"]}
</header>

<main id="main" role="main">

    <div class="container docs-wrapper">
        <div class="row">

            <section id="content" class="col-lg-9 col-md-8 col-sm-8 col-xs-12">
                <h3>修改密码</h3>
                <form method="post" id="form_password" name="form_login">
				<table class="table table-bordered">
					
					<tr>
						<td class="col-lg-3 col-sm-4 col-xs-5" align="right">新密码：</td>
						<td class="col-lg-9 col-sm-8 col-xs-7"><input type="password" value="" name="password2" size="12" placeholder="输入新密码"/></td>
					</tr>
					<tr>
						<td align="right">新密码确认：</td>
						<td><input type="password" value="" name="password3" size="12" placeholder="再次输入新密码"/></td>
					</tr>
					<tr>
						<td></td>
						<td><input type="button" value=" 提 交 " name="button_reg" id="button_reg" onclick="password(this.form);" class="btn-primary">
							<input type="reset" value="复 位" name="B2" class="btn-primary">
						</td>
					</tr>

				</table>
			</form>

            </section>

            <aside id="sidebar" class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
                {[include file="_left.tpl"]}
            </aside>

        </div>
    </div>
</main>

{[include file="_footer.tpl"]}

<script type="text/javascript">

	function password(form) {
		// alert("登录成功！");
		var body = $('#form_password').formSerialize();

		// var body = form.formSerialize();
		// alert(body);
		$.post('?do=User.passwordPost', body, function(json) {
			// alert($.toJSON(json));

			// alert("修改成功！");
			if (json.status == 1) {
				alert("密码修改成功！");
				window.open('?do=User.layout', '_self');
			} else if (json.status == 2) {
				alert("密码修改失败！旧密码输入有误！请重新输入！");
			} else if (json.status == 3) {
				alert("密码修改失败！新密码输入有误，请重新输入！");
			}

		}, 'json');
	}

</script>

</body>
</html>
